package com.pf.责任链模式.java;

public class Client {
    public static void main(String[] args) {
        Leader groupLeader = new GroupLeader("小组长");
        Leader managerLeader = new ManagerLeader("经理");
        Leader bossLeader = new BossLeader("老板");

        groupLeader.setNextLeader(managerLeader);
        managerLeader.setNextLeader(bossLeader);

        // 创建请假人
        // 测试责任链，当请假天数 <= 3 天，由小组长审批；请假天数 <= 10天，由经理审批；当请假天数大于10天，由老板审批。
        int leaveDays = 12;
        LeaveRequest leaveRequest = new LeaveRequest("张三", leaveDays, "事假");
        groupLeader.handleRequest(leaveRequest);
    }
}
